tools/xenstore: drop watch event messages exceeding maximum size
authorJuergen Gross <jgross@suse.com>
Tue, 15 Dec 2020 11:29:31 +0000 (12:29 +0100)
committerHans van Kranenburg <hans@knorrie.org>
Tue, 15 Dec 2020 11:29:31 +0000 (12:29 +0100)
commit2b0e50b01ce8ce3cb688f8976af2613717f68d3a
tree790c3ddafb898c16dfe3d0928134dfe8455d1839
parente2ffddc85f9aedcd42073ffb28b7f753cdc7a5a1
tools/xenstore: drop watch event messages exceeding maximum size

By setting a watch with a very large tag it is possible to trick
xenstored to send watch event messages exceeding the maximum allowed
payload size. This might in turn lead to a crash of xenstored as the
resulting error can cause dereferencing a NULL pointer in case there
is no active request being handled by the guest the watch event is
being sent to.

Fix that by just dropping such watch events. Additionally modify the
error handling to test the pointer to be not NULL before dereferencing
it.

This is XSA-324.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Julien Grall <jgrall@amazon.com>
tools/xenstore/xenstored_core.c
tools/xenstore/xenstored_watch.c